package week_03;
import java.util.Scanner;
public class PTA3_2 {
		String name;
		boolean gender;
		int age;
		int id;
		static int num=0;
		
		public PTA3_2() {
			System.out.println("This is constructor");
		}

		public PTA3_2(String name, boolean gender, int age) {
			this.name = name;
			this.gender = gender;
			this.age = age;
		}

		public String toString() {
			return "Person [name=" + name + ", gender=" + gender + ", age=" + age + ", id=" + id + "]";
		}
		static  {
			System.out.println("This is static initialization block");
		}
		{
			id=num;
			System.out.printf("This is initialization block, id is %d%n",num++);
		}

		public static void main(String[] args) {
			// TODO Auto-generated method stub

			Scanner in = new Scanner(System.in);
			int n = Integer.parseInt(in.nextLine());
			PTA3_2[] persons = new PTA3_2[n];
			for (int i = 0; i < persons.length; i++) {
				PTA3_2 person = new PTA3_2(in.next(), in.nextBoolean(), in.nextInt());
				persons[i] = person;
			}
			for (int j = persons.length - 1; j >= 0; j--) {
				System.out.println(persons[j]);
			}
			PTA3_2 person1=new PTA3_2();
			System.out.println(person1);
		}

	}
